<!DOCTYPE html>
<html>
<head>
    

    

    


<!-- Baidu Push -->
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
<!-- End Baidu Push -->


    <meta charset="utf-8">
    
    
    
    <title>MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7 | JK客栈 | 王怀亮的博客</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="阿里云,Linux,CentOS,MySQL,5.7,安装,JDK 1.8,配置">
    <meta name="description" content="本文介绍如何在 Linux CentOS 7.3 版本的阿里云上安装 JDK 1.8、MySQL 5.7">
<meta name="keywords" content="MySQL">
<meta property="og:type" content="article">
<meta property="og:title" content="MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7">
<meta property="og:url" content="http://www.jkinn.com/2017/04/10/2017041001/index.html">
<meta property="og:site_name" content="JK客栈">
<meta property="og:description" content="本文介绍如何在 Linux CentOS 7.3 版本的阿里云上安装 JDK 1.8、MySQL 5.7">
<meta property="og:updated_time" content="2017-04-10T07:48:21.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7">
<meta name="twitter:description" content="本文介绍如何在 Linux CentOS 7.3 版本的阿里云上安装 JDK 1.8、MySQL 5.7">
    
        <link rel="alternate" type="application/atom+xml" title="JK客栈" href="/atom.xml">
    
    <link rel="shortcut icon" href="/img/favicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>
</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">田埂↑の夢</h5>
          <a href="mailto:sdwanghuailiang@163.com" title="sdwanghuailiang@163.com" class="mail">sdwanghuailiang@163.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                归档
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                分类
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/sdwanghuailiang" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://www.weibo.com/sdwanghuailiang" target="_blank" >
                <i class="icon icon-lg icon-weibo"></i>
                微博
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://www.dongchunlin.com"  >
                <i class="icon icon-lg icon-link"></i>
                小董董
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7</h1>
        <h5 class="subtitle">
            
                <time datetime="2017-04-10T07:48:14.000Z" itemprop="datePublished" class="page-time">
  2017-04-10
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/MySQL/">MySQL</a></li></ul>

            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#已安装版本查看及卸载"><span class="post-toc-number">1.</span> <span class="post-toc-text">已安装版本查看及卸载</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#系统版本查看"><span class="post-toc-number">2.</span> <span class="post-toc-text">系统版本查看</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#安装-JDK-1-8"><span class="post-toc-number">3.</span> <span class="post-toc-text">安装 JDK 1.8</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#安装-MySQL-5-7"><span class="post-toc-number">4.</span> <span class="post-toc-text">安装 MySQL 5.7</span></a></li></ol>
        </nav>
    </aside>
    
<article id="post-2017041001"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7</h1>
        <div class="post-meta">
            <time class="post-time" title="2017-04-10 15:48:14" datetime="2017-04-10T07:48:14.000Z"  itemprop="datePublished">2017-04-10</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/MySQL/">MySQL</a></li></ul>



            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <p>最初公司购买的阿里云服务器是Linux CentOS 6.8版本的，在安装MySQL 5.7的过程中遇到了一些问题，系统总是提示各种依赖包不存在。折腾了一天，打败了好多小怪兽后最后总算安装好了，遗憾的是，当时的安装过程没有做记录。这几天公司又采购了一台阿里云，还是由我来搭建生产环境，为了以后公司有新的服务器加入时，弟兄们能无脑搭建环境，这次的安装过程我做了详细记录，其他的服务器版本不敢说，阿里云 CentOS 7.3 的服务器按照这个过程基本不会出现什么问题。</p>
<h1 id="已安装版本查看及卸载"><a href="#已安装版本查看及卸载" class="headerlink" title="已安装版本查看及卸载"></a>已安装版本查看及卸载</h1><p>因为我们的服务器是新采购的，上面什么东西都没有安装，甚至连JDK也没有，所以安装前我不需要检查软件是否安装，如果阁下的服务器是正在使用的，建议先检查某个软件是否已经安装，如果已经安装，需要咨询下领导是否要重新安装或者是否可移除。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">-- 检查软件是否已经安装，以MySQL为例</div><div class="line">[root@服务器主机名 opt]<span class="comment"># rpm -qa | grep -i mysql</span></div><div class="line">mysql-community-release-el7-5.noarch</div><div class="line">-- 如果有安装组件，则需要一个个的卸载掉</div><div class="line">[root@服务器主机名 opt]<span class="comment"># yum -y remove mysql-community-release-el7-5</span></div></pre></td></tr></table></figure>
<h1 id="系统版本查看"><a href="#系统版本查看" class="headerlink" title="系统版本查看"></a>系统版本查看</h1><p>我们才接收到公司采购的服务器时，基本都知道自己的服务器版本信息，当然有些情况我们是不知道服务器版本信息的，在这里我们先查询一下服务器信息：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div></pre></td><td class="code"><pre><div class="line">-- 查看系统内核版本</div><div class="line">[root@服务器主机名 ~]<span class="comment"># uname -a</span></div><div class="line">Linux 服务器主机名 3.10.0-514.21.1.el7.x86_64 <span class="comment">#1 SMP Thu May 25 17:04:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux</span></div><div class="line">[root@服务器主机名 ~]<span class="comment"># cat /proc/version</span></div><div class="line">Linux version 3.10.0-514.21.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) <span class="comment">#1 SMP Thu May 25 17:04:51 UTC 2017</span></div><div class="line">-- 查看系统发行版本</div><div class="line">[root@服务器主机名 ~]<span class="comment"># lsb_release -a</span></div><div class="line">LSB Version:	:core-4.1-amd64:core-4.1-noarch</div><div class="line">Distributor ID:	CentOS</div><div class="line">Description:	CentOS Linux release 7.3.1611 (Core) </div><div class="line">Release:	7.3.1611</div><div class="line">Codename:	Core</div><div class="line">[root@服务器主机名 ~]<span class="comment"># cat /etc/os-release</span></div><div class="line">NAME=<span class="string">"CentOS Linux"</span></div><div class="line">VERSION=<span class="string">"7 (Core)"</span></div><div class="line">ID=<span class="string">"centos"</span></div><div class="line">ID_LIKE=<span class="string">"rhel fedora"</span></div><div class="line">VERSION_ID=<span class="string">"7"</span></div><div class="line">PRETTY_NAME=<span class="string">"CentOS Linux 7 (Core)"</span></div><div class="line">ANSI_COLOR=<span class="string">"0;31"</span></div><div class="line">CPE_NAME=<span class="string">"cpe:/o:centos:centos:7"</span></div><div class="line">HOME_URL=<span class="string">"https://www.centos.org/"</span></div><div class="line">BUG_REPORT_URL=<span class="string">"https://bugs.centos.org/"</span></div><div class="line"></div><div class="line">CENTOS_MANTISBT_PROJECT=<span class="string">"CentOS-7"</span></div><div class="line">CENTOS_MANTISBT_PROJECT_VERSION=<span class="string">"7"</span></div><div class="line">REDHAT_SUPPORT_PRODUCT=<span class="string">"centos"</span></div><div class="line">REDHAT_SUPPORT_PRODUCT_VERSION=<span class="string">"7"</span></div><div class="line"></div><div class="line">[root@服务器主机名 ~]<span class="comment"># cat /etc/redhat-release</span></div><div class="line">CentOS Linux release 7.3.1611 (Core) </div><div class="line">[root@服务器主机名 ~]<span class="comment"># rpm -q centos-release</span></div><div class="line">centos-release-7-3.1611.el7.centos.x86_64</div><div class="line">......</div></pre></td></tr></table></figure>
<h1 id="安装-JDK-1-8"><a href="#安装-JDK-1-8" class="headerlink" title="安装 JDK 1.8"></a>安装 JDK 1.8</h1><p>我安装的时候JDK的最高版本是jdk-8u131，所以此处就以jdk-8u131为例进行安装，其他版本也一样：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div></pre></td><td class="code"><pre><div class="line">-- 安装JDK</div><div class="line">[root@服务器主机名 opt]<span class="comment"># rpm -ivh jdk-8u131-linux-x64.rpm </span></div><div class="line">Preparing...                          <span class="comment">################################# [100%]</span></div><div class="line">Updating / installing...</div><div class="line">   1:jdk1.8.0_131-2000:1.8.0_131-fcs  <span class="comment">################################# [100%]</span></div><div class="line">Unpacking JAR files...</div><div class="line">	tools.jar...</div><div class="line">	plugin.jar...</div><div class="line">	javaws.jar...</div><div class="line">	deploy.jar...</div><div class="line">	rt.jar...</div><div class="line">	jsse.jar...</div><div class="line">	charsets.jar...</div><div class="line">	localedata.jar...</div><div class="line">......</div></pre></td></tr></table></figure></p>
<p>安装完成后，查看JDK版本信息以判断是否安装成功：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">-- 查看JDK版本信息</div><div class="line">[root@服务器主机名 opt]<span class="comment"># java -version</span></div><div class="line">java version <span class="string">"1.8.0_131"</span></div><div class="line">Java(TM) SE Runtime Environment (build 1.8.0_131-b11)</div><div class="line">Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)</div></pre></td></tr></table></figure></p>
<h1 id="安装-MySQL-5-7"><a href="#安装-MySQL-5-7" class="headerlink" title="安装 MySQL 5.7"></a>安装 MySQL 5.7</h1><p>原则上在安装前，我们需要检查一下MySQL是否已经安装，因为我的服务器是全新的，不需要检查，此处我直接安装，如果阁下的服务器已经安装了软件，则回到本文前言处查看如何检查是否已安装MySQL。<br>此处我选择了rpm包安装的方式，这种方式比较快速，而且安装过程简单，为了方便兄弟们判断自己的安装过程是否正确，我把安装过程的大部分日志贴出来了供各位对比：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div><div class="line">72</div><div class="line">73</div><div class="line">74</div><div class="line">75</div><div class="line">76</div><div class="line">77</div><div class="line">78</div><div class="line">79</div><div class="line">80</div><div class="line">81</div><div class="line">82</div><div class="line">83</div><div class="line">84</div><div class="line">85</div><div class="line">86</div><div class="line">87</div><div class="line">88</div><div class="line">89</div><div class="line">90</div><div class="line">91</div><div class="line">92</div><div class="line">93</div><div class="line">94</div><div class="line">95</div><div class="line">96</div><div class="line">97</div><div class="line">98</div><div class="line">99</div><div class="line">100</div><div class="line">101</div><div class="line">102</div><div class="line">103</div><div class="line">104</div><div class="line">105</div><div class="line">106</div><div class="line">107</div><div class="line">108</div><div class="line">109</div><div class="line">110</div><div class="line">111</div><div class="line">112</div><div class="line">113</div><div class="line">114</div><div class="line">115</div><div class="line">116</div><div class="line">117</div><div class="line">118</div><div class="line">119</div><div class="line">120</div><div class="line">121</div><div class="line">122</div><div class="line">123</div><div class="line">124</div><div class="line">125</div><div class="line">126</div><div class="line">127</div><div class="line">128</div><div class="line">129</div><div class="line">130</div><div class="line">131</div><div class="line">132</div><div class="line">133</div><div class="line">134</div><div class="line">135</div><div class="line">136</div><div class="line">137</div><div class="line">138</div><div class="line">139</div><div class="line">140</div><div class="line">141</div><div class="line">142</div><div class="line">143</div><div class="line">144</div><div class="line">145</div><div class="line">146</div><div class="line">147</div><div class="line">148</div><div class="line">149</div><div class="line">150</div><div class="line">151</div><div class="line">152</div><div class="line">153</div><div class="line">154</div><div class="line">155</div><div class="line">156</div><div class="line">157</div><div class="line">158</div><div class="line">159</div><div class="line">160</div><div class="line">161</div><div class="line">162</div><div class="line">163</div><div class="line">164</div><div class="line">165</div><div class="line">166</div><div class="line">167</div><div class="line">168</div><div class="line">169</div></pre></td><td class="code"><pre><div class="line">-- 下载MySQL 5.7 rpm 安装包</div><div class="line">[root@服务器主机名 opt]<span class="comment"># wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm</span></div><div class="line">--2017-06-20 10:45:38--  http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm</div><div class="line">Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11</div><div class="line">Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:80... connected.</div><div class="line">HTTP request sent, awaiting response... 301 Moved Permanently</div><div class="line">Location: https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm [following]</div><div class="line">--2017-06-20 10:45:38--  https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm</div><div class="line">Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... connected.</div><div class="line">HTTP request sent, awaiting response... 302 Found</div><div class="line">Location: https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm [following]</div><div class="line">--2017-06-20 10:45:40--  https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm</div><div class="line">Resolving repo.mysql.com (repo.mysql.com)... 23.10.6.195</div><div class="line">Connecting to repo.mysql.com (repo.mysql.com)|23.10.6.195|:443... connected.</div><div class="line">HTTP request sent, awaiting response... 200 OK</div><div class="line">Length: 25680 (25K) [application/x-redhat-package-manager]</div><div class="line">Saving to: ‘mysql57-community-release-el7-11.noarch.rpm’</div><div class="line"></div><div class="line">100%[==================================================================================================================================&gt;] 25,680      --.-K/s   <span class="keyword">in</span> 0.06s   </div><div class="line"></div><div class="line">2017-06-20 10:45:40 (421 KB/s) - ‘mysql57-community-release-el7-11.noarch.rpm’ saved [25680/25680]</div><div class="line"></div><div class="line">-- 安装MySQL rpm 安装包，一路除了输入[y]就是回车</div><div class="line">[root@服务器主机名 opt]<span class="comment"># yum localinstall mysql57-community-release-el7-11.noarch.rpm</span></div><div class="line">Loaded plugins: fastestmirror</div><div class="line">Examining mysql57-community-release-el7-11.noarch.rpm: mysql57-community-release-el7-11.noarch</div><div class="line">Marking mysql57-community-release-el7-11.noarch.rpm to be installed</div><div class="line">Resolving Dependencies</div><div class="line">--&gt; Running transaction check</div><div class="line">---&gt; Package mysql57-community-release.noarch 0:el7-11 will be installed</div><div class="line">--&gt; Finished Dependency Resolution</div><div class="line"></div><div class="line">Dependencies Resolved</div><div class="line"></div><div class="line">============================================================================================================================================================================</div><div class="line"> Package                                        Arch                        Version                     Repository                                                     Size</div><div class="line">============================================================================================================================================================================</div><div class="line">Installing:</div><div class="line"> mysql57-community-release                      noarch                      el7-11                      /mysql57-community-release-el7-11.noarch                       31 k</div><div class="line"></div><div class="line">Transaction Summary</div><div class="line">============================================================================================================================================================================</div><div class="line">Install  1 Package</div><div class="line"></div><div class="line">Total size: 31 k</div><div class="line">Installed size: 31 k</div><div class="line">-- 输入 y</div><div class="line">Is this ok [y/d/N]: y</div><div class="line">Downloading packages:</div><div class="line">Running transaction check</div><div class="line">Running transaction <span class="built_in">test</span></div><div class="line">Transaction <span class="built_in">test</span> succeeded</div><div class="line">Running transaction</div><div class="line">Warning: RPMDB altered outside of yum.</div><div class="line">  Installing : mysql57-community-release-el7-11.noarch                                                                                                                  1/1 </div><div class="line">  Verifying  : mysql57-community-release-el7-11.noarch                                                                                                                  1/1 </div><div class="line"></div><div class="line">Installed:</div><div class="line">  mysql57-community-release.noarch 0:el7-11                                                                                                                                 </div><div class="line"></div><div class="line">Complete!</div><div class="line"></div><div class="line">-- 查看刚才的安装过程是否成功（看看安装了哪些MySQL组件即可）</div><div class="line">[root@服务器主机名 opt]<span class="comment"># yum repolist enabled | grep "mysql.*-community.*"</span></div><div class="line">mysql-connectors-community/x86_64 MySQL Connectors Community                  36</div><div class="line">mysql-tools-community/x86_64      MySQL Tools Community                       47</div><div class="line">mysql57-community/x86_64          MySQL 5.7 Community Server                 187</div><div class="line"></div><div class="line">-- 安装MySQL服务器，同样一路除了输入[y]就是回车</div><div class="line">[root@服务器主机名 opt]<span class="comment"># yum install mysql-community-server</span></div><div class="line">Loaded plugins: fastestmirror</div><div class="line">Loading mirror speeds from cached hostfile</div><div class="line"> * base: mirrors.aliyun.com</div><div class="line"> * epel: mirrors.aliyun.com</div><div class="line"> * extras: mirrors.aliyun.com</div><div class="line"> * updates: mirrors.aliyun.com</div><div class="line">Resolving Dependencies</div><div class="line">--&gt; Running transaction check</div><div class="line">---&gt; Package mysql-community-server.x86_64 0:5.7.18-1.el7 will be installed</div><div class="line">--&gt; Processing Dependency: mysql-community-common(x86-64) = 5.7.18-1.el7 <span class="keyword">for</span> package: mysql-community-server-5.7.18-1.el7.x86_64</div><div class="line">--&gt; Processing Dependency: mysql-community-client(x86-64) &gt;= 5.7.9 <span class="keyword">for</span> package: mysql-community-server-5.7.18-1.el7.x86_64</div><div class="line">--&gt; Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) <span class="keyword">for</span> package: mysql-community-server-5.7.18-1.el7.x86_64</div><div class="line">--&gt; Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) <span class="keyword">for</span> package: mysql-community-server-5.7.18-1.el7.x86_64</div><div class="line">--&gt; Processing Dependency: libaio.so.1()(64bit) <span class="keyword">for</span> package: mysql-community-server-5.7.18-1.el7.x86_64</div><div class="line">--&gt; Running transaction check</div><div class="line">---&gt; Package libaio.x86_64 0:0.3.109-13.el7 will be installed</div><div class="line">---&gt; Package mysql-community-client.x86_64 0:5.7.18-1.el7 will be installed</div><div class="line">--&gt; Processing Dependency: mysql-community-libs(x86-64) &gt;= 5.7.9 <span class="keyword">for</span> package: mysql-community-client-5.7.18-1.el7.x86_64</div><div class="line">---&gt; Package mysql-community-common.x86_64 0:5.7.18-1.el7 will be installed</div><div class="line">--&gt; Running transaction check</div><div class="line">---&gt; Package mariadb-libs.x86_64 1:5.5.52-1.el7 will be obsoleted</div><div class="line">--&gt; Processing Dependency: libmysqlclient.so.18()(64bit) <span class="keyword">for</span> package: 2:postfix-2.10.1-6.el7.x86_64</div><div class="line">--&gt; Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) <span class="keyword">for</span> package: 2:postfix-2.10.1-6.el7.x86_64</div><div class="line">---&gt; Package mysql-community-libs.x86_64 0:5.7.18-1.el7 will be obsoleting</div><div class="line">--&gt; Running transaction check</div><div class="line">---&gt; Package mysql-community-libs-compat.x86_64 0:5.7.18-1.el7 will be obsoleting</div><div class="line">--&gt; Finished Dependency Resolution</div><div class="line"></div><div class="line">Dependencies Resolved</div><div class="line"></div><div class="line">============================================================================================================================================================================</div><div class="line"> Package                                             Arch                           Version                                 Repository                                 Size</div><div class="line">============================================================================================================================================================================</div><div class="line">Installing:</div><div class="line"> mysql-community-libs                                x86_64                         5.7.18-1.el7                            mysql57-community                         2.1 M</div><div class="line">     replacing  mariadb-libs.x86_64 1:5.5.52-1.el7</div><div class="line"> mysql-community-libs-compat                         x86_64                         5.7.18-1.el7                            mysql57-community                         2.0 M</div><div class="line">     replacing  mariadb-libs.x86_64 1:5.5.52-1.el7</div><div class="line"> mysql-community-server                              x86_64                         5.7.18-1.el7                            mysql57-community                         162 M</div><div class="line">Installing <span class="keyword">for</span> dependencies:</div><div class="line"> libaio                                              x86_64                         0.3.109-13.el7                          base                                       24 k</div><div class="line"> mysql-community-client                              x86_64                         5.7.18-1.el7                            mysql57-community                          24 M</div><div class="line"> mysql-community-common                              x86_64                         5.7.18-1.el7                            mysql57-community                         271 k</div><div class="line"></div><div class="line">Transaction Summary</div><div class="line">============================================================================================================================================================================</div><div class="line">Install  3 Packages (+3 Dependent packages)</div><div class="line"></div><div class="line">Total download size: 190 M</div><div class="line">-- 输入 y</div><div class="line">Is this ok [y/d/N]: y</div><div class="line">Downloading packages:</div><div class="line">(1/6): libaio-0.3.109-13.el7.x86_64.rpm                                                                                                              |  24 kB  00:00:00     </div><div class="line">warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.18-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY</div><div class="line">Public key <span class="keyword">for</span> mysql-community-common-5.7.18-1.el7.x86_64.rpm is not installed</div><div class="line">(2/6): mysql-community-common-5.7.18-1.el7.x86_64.rpm                                                                                                | 271 kB  00:00:00     </div><div class="line">(3/6): mysql-community-libs-5.7.18-1.el7.x86_64.rpm                                                                                                  | 2.1 MB  00:00:00     </div><div class="line">(4/6): mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm                                                                                           | 2.0 MB  00:00:00     </div><div class="line">(5/6): mysql-community-client-5.7.18-1.el7.x86_64.rpm                                                                                                |  24 MB  00:00:02     </div><div class="line">(6/6): mysql-community-server-5.7.18-1.el7.x86_64.rpm                                                                                                | 162 MB  00:00:15     </div><div class="line">----------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div><div class="line">Total                                                                                                                                        12 MB/s | 190 MB  00:00:16     </div><div class="line">Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql</div><div class="line">Importing GPG key 0x5072E1F5:</div><div class="line"> Userid     : <span class="string">"MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;"</span></div><div class="line"> Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5</div><div class="line"> Package    : mysql57-community-release-el7-11.noarch (installed)</div><div class="line"> From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql</div><div class="line">-- 输入 y</div><div class="line">Is this ok [y/N]: y</div><div class="line">Running transaction check</div><div class="line">Running transaction <span class="built_in">test</span></div><div class="line">Transaction <span class="built_in">test</span> succeeded</div><div class="line">Running transaction</div><div class="line">  Installing : mysql-community-common-5.7.18-1.el7.x86_64                                                                                                               1/7 </div><div class="line">  Installing : mysql-community-libs-5.7.18-1.el7.x86_64                                                                                                                 2/7 </div><div class="line">  Installing : mysql-community-client-5.7.18-1.el7.x86_64                                                                                                               3/7 </div><div class="line">  Installing : libaio-0.3.109-13.el7.x86_64                                                                                                                             4/7 </div><div class="line">  Installing : mysql-community-server-5.7.18-1.el7.x86_64                                                                                                               5/7 </div><div class="line">  Installing : mysql-community-libs-compat-5.7.18-1.el7.x86_64                                                                                                          6/7 </div><div class="line">  Erasing    : 1:mariadb-libs-5.5.52-1.el7.x86_64                                                                                                                       7/7 </div><div class="line">  Verifying  : mysql-community-server-5.7.18-1.el7.x86_64                                                                                                               1/7 </div><div class="line">  Verifying  : mysql-community-common-5.7.18-1.el7.x86_64                                                                                                               2/7 </div><div class="line">  Verifying  : mysql-community-client-5.7.18-1.el7.x86_64                                                                                                               3/7 </div><div class="line">  Verifying  : mysql-community-libs-compat-5.7.18-1.el7.x86_64                                                                                                          4/7 </div><div class="line">  Verifying  : libaio-0.3.109-13.el7.x86_64                                                                                                                             5/7 </div><div class="line">  Verifying  : mysql-community-libs-5.7.18-1.el7.x86_64                                                                                                                 6/7 </div><div class="line">  Verifying  : 1:mariadb-libs-5.5.52-1.el7.x86_64                                                                                                                       7/7 </div><div class="line"></div><div class="line">Installed:</div><div class="line">  mysql-community-libs.x86_64 0:5.7.18-1.el7            mysql-community-libs-compat.x86_64 0:5.7.18-1.el7            mysql-community-server.x86_64 0:5.7.18-1.el7           </div><div class="line"></div><div class="line">Dependency Installed:</div><div class="line">  libaio.x86_64 0:0.3.109-13.el7                 mysql-community-client.x86_64 0:5.7.18-1.el7                 mysql-community-common.x86_64 0:5.7.18-1.el7                </div><div class="line"></div><div class="line">Replaced:</div><div class="line">  mariadb-libs.x86_64 1:5.5.52-1.el7                                                                                                                                        </div><div class="line"></div><div class="line">Complete!</div></pre></td></tr></table></figure></p>
<p>这样 MySQL 就安装完成了，简单吧，其实只要系统没有缺少依赖包，安装MySQL就不会出现什么问题。<br>好了，接下来我们启动MySQL服务：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div></pre></td><td class="code"><pre><div class="line">-- 安装完毕，启动MySQL服务 </div><div class="line">[root@服务器主机名 opt]<span class="comment"># systemctl start mysqld</span></div><div class="line"></div><div class="line">-- 查看MySQL状态</div><div class="line">[root@服务器主机名 opt]<span class="comment"># systemctl status mysqld</span></div><div class="line">● mysqld.service - MySQL Server</div><div class="line">   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)</div><div class="line">   Active: active (running) since Tue 2017-06-20 10:50:44 CST; 12s ago</div><div class="line">     Docs: man:mysqld(8)</div><div class="line">           http://dev.mysql.com/doc/refman/en/using-systemd.html</div><div class="line">  Process: 20502 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid <span class="variable">$MYSQLD_OPTS</span> (code=exited, status=0/SUCCESS)</div><div class="line">  Process: 20426 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)</div><div class="line"> Main PID: 20504 (mysqld)</div><div class="line">   CGroup: /system.slice/mysqld.service</div><div class="line">           └─20504 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid</div><div class="line"></div><div class="line">Jun 20 10:50:39 服务器主机名 systemd[1]: Starting MySQL Server...</div><div class="line">Jun 20 10:50:44 服务器主机名 systemd[1]: Started MySQL Server.</div><div class="line"></div><div class="line">-- 当然你也可以这样启动MySQL服务</div><div class="line">[root@服务器主机名 opt]<span class="comment"># systemctl enable mysqld</span></div><div class="line">-- 重新加载配置文件</div><div class="line">[root@服务器主机名 opt]<span class="comment"># systemctl daemon-reload</span></div></pre></td></tr></table></figure>
<p>现在小伙伴们应该有个疑问，安装过程中没有配置访问密码，那我们的数据库密码是多少呢？甭担心，安装过程中 MySQL 生成了首次访问的默认密码，通过以下命令我们就可以查找到 MySQL 的访问密码：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-- 查询 MySQL 默认密码</div><div class="line">[root@服务器主机名 opt]<span class="comment"># grep 'temporary password' /var/log/mysqld.log</span></div><div class="line">2017-06-20T02:50:40.691736Z 1 [Note] A temporary password is generated <span class="keyword">for</span> root@localhost: Oot)8y;ih&gt;<span class="comment">#K</span></div></pre></td></tr></table></figure>
<p>看见了没，root@localhost:后边的 Oot)8y;ih&gt;#K 就是我们的 MySQL 密码。</p>
<p>现在我们就可以进入我们的MySQL玩耍了,首先我们要做的就是修改 root 账户的密码，毕竟默认密码太不安全了（<strong>这里需要注意的是，MySQL 5.7的密码安全性验证很强，需要同时包含有大写字母、小写字母、特殊符号、数字，并且长度不能少于8位</strong>）：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div></pre></td><td class="code"><pre><div class="line">-- 登录MySQL</div><div class="line">[root@服务器主机名 opt]<span class="comment"># mysql -uroot -p</span></div><div class="line">Enter password: </div><div class="line">Welcome to the MySQL monitor.  Commands end with ; or \g.</div><div class="line">Your MySQL connection id is 3</div><div class="line">Server version: 5.7.18</div><div class="line"></div><div class="line">Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.</div><div class="line"></div><div class="line">Oracle is a registered trademark of Oracle Corporation and/or its</div><div class="line">affiliates. Other names may be trademarks of their respective</div><div class="line">owners.</div><div class="line"></div><div class="line">Type <span class="string">'help;'</span> or <span class="string">'\h'</span> <span class="keyword">for</span> <span class="built_in">help</span>. Type <span class="string">'\c'</span> to clear the current input statement.</div><div class="line"></div><div class="line">mysql&gt; ALTER USER <span class="string">'root'</span>@<span class="string">'localhost'</span> IDENTIFIED BY <span class="string">'你的密码'</span>;</div><div class="line">Query OK, 0 rows affected (0.00 sec)</div><div class="line"></div><div class="line">mysql&gt; quit</div><div class="line">Bye</div></pre></td></tr></table></figure>
<p>在正式使用 MySQL 时，我们肯定不能使用root用户操作数据库，因为root用户的权限太大，稍不留神，手一抖数据库就废了，所以下一步我们需要创建一个普通用户：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div></pre></td><td class="code"><pre><div class="line">-- 登录MySQL</div><div class="line">[root@服务器主机名 opt]<span class="comment"># mysql -uroot -p</span></div><div class="line">Enter password: </div><div class="line">Welcome to the MySQL monitor.  Commands end with ; or \g.</div><div class="line">Your MySQL connection id is 4</div><div class="line">Server version: 5.7.18 MySQL Community Server (GPL)</div><div class="line"></div><div class="line">Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.</div><div class="line"></div><div class="line">Oracle is a registered trademark of Oracle Corporation and/or its</div><div class="line">affiliates. Other names may be trademarks of their respective</div><div class="line">owners.</div><div class="line"></div><div class="line">Type <span class="string">'help;'</span> or <span class="string">'\h'</span> <span class="keyword">for</span> <span class="built_in">help</span>. Type <span class="string">'\c'</span> to clear the current input statement.</div><div class="line"></div><div class="line">mysql&gt; GRANT ALL PRIVILEGES ON *.* TO <span class="string">'用户名'</span>@<span class="string">'%'</span> IDENTIFIED BY <span class="string">'用户密码'</span> WITH GRANT OPTION;</div><div class="line">Query OK, 0 rows affected, 1 warning (0.00 sec)</div><div class="line"></div><div class="line">mysql&gt; quit</div><div class="line">Bye</div></pre></td></tr></table></figure>
<p>测试我们新建的用户是否能登录：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div></pre></td><td class="code"><pre><div class="line">[root@服务器主机名 opt]<span class="comment"># mysql -uzxjy -p</span></div><div class="line">Enter password: </div><div class="line">Welcome to the MySQL monitor.  Commands end with ; or \g.</div><div class="line">Your MySQL connection id is 5</div><div class="line">Server version: 5.7.18 MySQL Community Server (GPL)</div><div class="line"></div><div class="line">Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.</div><div class="line"></div><div class="line">Oracle is a registered trademark of Oracle Corporation and/or its</div><div class="line">affiliates. Other names may be trademarks of their respective</div><div class="line">owners.</div><div class="line"></div><div class="line">Type <span class="string">'help;'</span> or <span class="string">'\h'</span> <span class="keyword">for</span> <span class="built_in">help</span>. Type <span class="string">'\c'</span> to clear the current input statement.</div><div class="line"></div><div class="line">mysql&gt;</div><div class="line"></div><div class="line">......</div></pre></td></tr></table></figure>
<p>由于公司规定数据库的编码都必须是utf-8，所以接下来我们需要把 MySQL 的数据库编码改为 utf-8。编辑 MySQL 的配置文件，在其中添加character_set_server=utf8、init_connect=’SET NAMES utf8’两句，如下所示：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div></pre></td><td class="code"><pre><div class="line">[root@服务器主机名 opt]<span class="comment"># cat /etc/my.cnf</span></div><div class="line"><span class="comment"># For advice on how to change settings please see</span></div><div class="line"><span class="comment"># http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html</span></div><div class="line"></div><div class="line">[mysqld]</div><div class="line"></div><div class="line"><span class="comment">#添加下边这两句</span></div><div class="line">character_set_server=utf8</div><div class="line">init_connect=<span class="string">'SET NAMES utf8'</span></div><div class="line"></div><div class="line"><span class="comment">#</span></div><div class="line"><span class="comment"># Remove leading # and set to the amount of RAM for the most important data</span></div><div class="line"><span class="comment"># cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.</span></div><div class="line"><span class="comment"># innodb_buffer_pool_size = 128M</span></div><div class="line"><span class="comment">#</span></div><div class="line"><span class="comment"># Remove leading # to turn on a very important data integrity option: logging</span></div><div class="line"><span class="comment"># changes to the binary log between backups.</span></div><div class="line"><span class="comment"># log_bin</span></div><div class="line"><span class="comment">#</span></div><div class="line"><span class="comment"># Remove leading # to set options mainly useful for reporting servers.</span></div><div class="line"><span class="comment"># The server defaults are faster for transactions and fast SELECTs.</span></div><div class="line"><span class="comment"># Adjust sizes as needed, experiment to find the optimal values.</span></div><div class="line"><span class="comment"># join_buffer_size = 128M</span></div><div class="line"><span class="comment"># sort_buffer_size = 2M</span></div><div class="line"><span class="comment"># read_rnd_buffer_size = 2M</span></div><div class="line">datadir=/var/lib/mysql</div><div class="line">socket=/var/lib/mysql/mysql.sock</div><div class="line"></div><div class="line"><span class="comment"># Disabling symbolic-links is recommended to prevent assorted security risks</span></div><div class="line">symbolic-links=0</div><div class="line"></div><div class="line"><span class="built_in">log</span>-error=/var/<span class="built_in">log</span>/mysqld.log</div><div class="line">pid-file=/var/run/mysqld/mysqld.pid</div></pre></td></tr></table></figure>
<p>查看编码是否修改：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div></pre></td><td class="code"><pre><div class="line">-- 重启MySQL</div><div class="line">[root@服务器主机名 opt]<span class="comment"># systemctl restart mysqld</span></div><div class="line">[root@服务器主机名 opt]<span class="comment"># mysql -uroot -p</span></div><div class="line">Enter password: </div><div class="line">Welcome to the MySQL monitor.  Commands end with ; or \g.</div><div class="line">Your MySQL connection id is 3</div><div class="line">Server version: 5.7.18 MySQL Community Server (GPL)</div><div class="line"></div><div class="line">Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.</div><div class="line"></div><div class="line">Oracle is a registered trademark of Oracle Corporation and/or its</div><div class="line">affiliates. Other names may be trademarks of their respective</div><div class="line">owners.</div><div class="line"></div><div class="line">Type <span class="string">'help;'</span> or <span class="string">'\h'</span> <span class="keyword">for</span> <span class="built_in">help</span>. Type <span class="string">'\c'</span> to clear the current input statement.</div><div class="line"></div><div class="line">mysql&gt; show variables like <span class="string">'%character%'</span>;</div><div class="line">+--------------------------+----------------------------+</div><div class="line">| Variable_name            | Value                      |</div><div class="line">+--------------------------+----------------------------+</div><div class="line">| character_set_client     | utf8                       |</div><div class="line">| character_set_connection | utf8                       |</div><div class="line">| character_set_database   | utf8                       |</div><div class="line">| character_set_filesystem | binary                     |</div><div class="line">| character_set_results    | utf8                       |</div><div class="line">| character_set_server     | utf8                       |</div><div class="line">| character_set_system     | utf8                       |</div><div class="line">| character_sets_dir       | /usr/share/mysql/charsets/ |</div><div class="line">+--------------------------+----------------------------+</div><div class="line">8 rows <span class="keyword">in</span> <span class="built_in">set</span> (0.01 sec)</div></pre></td></tr></table></figure>
<p>好了，到现在，我们的MySQL就安装完成了，具体的配置就看阁下公司内部的具体规定了。</p>

        </div>

        <blockquote class="post-copyright">
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2017-04-10T07:48:21.000Z" itemprop="dateUpdated">2017-04-10 15:48:21</time>
</span><br>


        
        【转载请注明出处】<a href="/2017/04/10/2017041001/" target="_blank" rel="external">http://www.jkinn.com/2017/04/10/2017041001/</a>
        
    </div>
    <footer>
        <a href="http://www.jkinn.com">
            <img src="/img/avatar.jpg" alt="田埂↑の夢">
            田埂↑の夢
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/MySQL/">MySQL</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://www.jkinn.com/2017/04/10/2017041001/&title=《MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7》 — JK客栈&pic=http://www.jkinn.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://www.jkinn.com/2017/04/10/2017041001/&title=《MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7》 — JK客栈&source=本站是 JK客栈 田埂上的梦（田埂↑の夢 王怀亮）的技术分享博客。内容涵盖Java后端技术、微服务架构、分布式架构、网络安全、运维开发等相关的研究与知识分享。" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://www.jkinn.com/2017/04/10/2017041001/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7》 — JK客栈&url=http://www.jkinn.com/2017/04/10/2017041001/&via=http://www.jkinn.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://www.jkinn.com/2017/04/10/2017041001/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2017/08/16/20170816001/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> 上一篇</div>
        <h5 class="title">Redis 深入探讨（一）：Linux CentOS 7.3 安装 Redis 4.0.1</h5>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2017/01/09/2017010901/" id="post-next" class="post-nav-link">
        <div class="tips">下一篇 <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h5 class="title">零基础 Hexo + Coding、Github、码云(oschina)搭建个人博客（六） —— Markdown常用语法及工具</h5>
      </a>
    </div>
  
</nav>



    





<section class="comments" id="comments">
    <!-- UY BEGIN -->
    <div id="uyan_frame"></div>
    <script src="http://v2.uyan.cc/code/uyan.js?uid=2137675"></script>
    <!-- UY END -->
</section>










</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢您的支持
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="/img/wechat.jpg" alt="打赏二维码">
        </div>
        
        <label class="reward-toggle">
            <input id="rewardToggle" type="checkbox" class="reward-toggle-check"
                data-wechat="/img/wechat.jpg" data-alipay="/img/alipay.jpg">
            <div class="reward-toggle-ctrol">
                <span class="reward-toggle-item wechat">微信</span>
                <span class="reward-toggle-label"></span>
                <span class="reward-toggle-item alipay">支付宝</span>
            </div>
        </label>
        
    </div>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <!--<p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循 <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>-->
        </p>
    </div>
    <div class="bottom">
        <p><span>田埂↑の夢 &copy; 2015 - 2017</span>
            <span>
                
                <!--Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>-->
				田埂上的梦（王怀亮的博客）
            </span>
        </p>
    </div>
	


<!-- Baidu Push -->
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
<!-- End Baidu Push -->



</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://www.jkinn.com/2017/04/10/2017041001/&title=《MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7》 — JK客栈&pic=http://www.jkinn.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://www.jkinn.com/2017/04/10/2017041001/&title=《MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7》 — JK客栈&source=本站是 JK客栈 田埂上的梦（田埂↑の夢 王怀亮）的技术分享博客。内容涵盖Java后端技术、微服务架构、分布式架构、网络安全、运维开发等相关的研究与知识分享。" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://www.jkinn.com/2017/04/10/2017041001/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《MySQL 深入探讨（一）： 阿里云 Linux CentOS 7.3 安装配置 JDK-1.8、MySQL-5.7》 — JK客栈&url=http://www.jkinn.com/2017/04/10/2017041001/&via=http://www.jkinn.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://www.jkinn.com/2017/04/10/2017041001/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


lazyScripts.push('//s95.cnzz.com/z_stat.php?id=1262549369&web_id=1262549369')

</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '死鬼去哪里了！';
            clearTimeout(titleTime);
        } else {
            document.title = '欢迎回来';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
